package nkw;

import junit.framework.TestCase;

/**
 * Verifies that getDegreesToTurnToFacePoint() behaves correctly.
 * 
 * @author Noah Woodden
 */
public class TestBehaviorThree extends TestCase {

  /**
   * Test the getDegreesToTurnToFacePoint() functionality.
   */
  public void testDegreesToTurnToFacePoint() {
    CompetitiveRobot robot = new CompetitiveRobot();

    assertEquals("Robot did not turn a specified 45 degrees as expected.", 45.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, 1, 1));
    assertEquals("Robot did not turn a specified 90 degrees as expected.", 90.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, 1, 0));
    assertEquals("Robot did not turn a specified 135 degrees as expected.", 135.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, 1, -1));
    assertEquals("Robot did not turn a specified 180 degrees as expected.", 180.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, 0, -1));
    assertEquals("Robot did not turn a specified 225 degrees as expected.", 225.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, -1, -1));
    assertEquals("Robot did not turn a specified 270 degrees as expected.", 270.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, -1, 0));
    assertEquals("Robot did not turn a specified 315 degrees as expected.", 315.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, -1, 1));
    assertEquals("Robot did not turn a specified 0 degrees as expected.", 0.0,
        robot.getDegreesToTurnToFacePoint(0, 0, 0, 0, 1));
  }
}
